#include "AsianOption.h"

double AsianOption::payoff(const std::vector<double>& stockPrices
) const {
	double avgPrice = mean(stockPrices);
	double strike = getStrike();
	if (avgPrice > strike) {
		return avgPrice - strike;
	}
	else {
		return 0;
	}
}

double AsianOption::price(const BlackScholesModel& bsm) const {
	MonteCarloPricer pricer;
	return pricer.price(*this, bsm);

}

void testAsianOption() {
	std::cout << "WARNINGS::AsianOption is not tested by the author" << std::endl;
}